
import type { FriendShipInfo, Pagination, QueryFriendFrom } from "@/types/views/friend";
import request from "./request";
import { Controller } from '@/api/request'
export const friendListApi = (params: Pagination & QueryFriendFrom) => request<any, ApiRes<{ total: number, rows: FriendShipInfo[] }>>({
    url: `${Controller.friendship}/list`,
    params
});

export const userListApi = (params: Pagination & QueryFriendFrom) => request<any, ApiRes<{ total: number, rows: FriendShipInfo[] }>>({
    url: `${Controller.friendship}/list/user`,
    params
});

export const addFriendApi = (data: { friendId: number, reason?: string }) => request<any, ApiRes<null>>({
    url: `${Controller.friendship}/add`,
    method: 'post',
    data
});
export const delFriendApi = (id: number) => request<any, ApiRes<null>>({
    url: `${Controller.friendship}/remove/${id}`,
    method: 'delete'
});

